﻿<UserControl x:Class="BassTuner.UI.WPF.BassTunerView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d">
    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="BoolToVis" />
            <Storyboard TargetProperty="RenderTransform.Angle" x:Key="Storyboard">
                <DoubleAnimation
                    From="-5" To="5" Duration="0:0:0.05"
                    AutoReverse="True"
                    RepeatBehavior="3x"
                    FillBehavior="Stop"
                    />
            </Storyboard>
    </UserControl.Resources>

    <Grid HorizontalAlignment="Center" Width="300">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="3*" />
        </Grid.RowDefinitions>
        <TabControl Grid.Row="0">
            <TabItem>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <WrapPanel Name="InstrumentsTypes" Grid.Row="0" HorizontalAlignment="Center"/>
                    <ComboBox Name="TuningType" Grid.Row="1" Grid.Column="0"
                              Visibility="{Binding InstrumentTuningVisible, Converter={StaticResource BoolToVis}}"
                              ItemsSource="{Binding InstrumentTunings}"
                              SelectedItem="{Binding CurrentlyActiveInstrumentTuning}" 
                              HorizontalAlignment="Center" 
                              Height="40"/>
                    <WrapPanel Name="InstrumentsTunings" Grid.Row="2" HorizontalAlignment="Center">
                        <WrapPanel.Resources>
                            <Style TargetType="{x:Type Button}" BasedOn="{StaticResource MetroButton}">
                                <Setter Property="HorizontalAlignment" Value="Center" />
                                <Setter Property="Margin" Value="12" />
                                <Setter Property="RenderTransformOrigin" Value="0.5 0.5" />
                                <Setter Property="RenderTransform">
                                    <Setter.Value>
                                        <RotateTransform />
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </WrapPanel.Resources>
                    </WrapPanel>
                    <WrapPanel Grid.Row="3" HorizontalAlignment="Center" ItemHeight="30"
                               Visibility="{Binding PlayerButtonsVisibility, Converter={StaticResource BoolToVis}}">
                        <Button Content="{Binding PrevContent}" IsEnabled="{Binding IsPrevEnabled}"
                                Command="{Binding PlayPrevSoundCommand}" />
                        <Button Content="{Binding StopStartContent}" Command="{Binding PlayStopSoundCommand}" />
                        <Button Content="{Binding NextContent}" IsEnabled="{Binding IsNextEnabled}"
                                Command="{Binding PlayNextSoundCommand}" />
                    </WrapPanel>
                </Grid>
            </TabItem>
        </TabControl>
    </Grid>
</UserControl>